package day06_exception_collection.com.itheima.d2_collection;

import java.util.ArrayList;
import java.util.HashSet;

public class CollectionDemo1 {
    public static void main(String[] args) {
        ArrayList<String> list = new ArrayList<>();
        list.add("hello");
        list.add("world");
        list.add("java");
        list.add("张三");
        System.out.println(list);
        System.out.println("list.get(2) = " + list.get(2));

        HashSet<String> set = new HashSet<>();
        set.add("hello");
        set.add("world");
        set.add("java");
        System.out.println(set);
//        System.out.println("set.get(2) = " + set.get(2));
    }
}
